import { RouteRecordRaw } from 'vue-router'

export const staticRouter: RouteRecordRaw[] = [
	{
		path: '/login',
		name: "login",
		component: () => import("@/views/sys/login/index.vue"),
		meta: {
		  title: "登录"
		}
	},
    {
		path: '/',
		redirect: 'home/index'
	},
	{
		path: '/layout',
		name: 'layout',
		component: () => import('@/layouts/index.vue'),
		// component: () => import('@/layouts/indexAsync.vue'),
		redirect: 'home/index',
		children: [
			{
				path: '/home/index',
				name: 'home',
				meta: { title: '首页' },
				component: () => import('@/views/home/index.vue'),
			},
			{
				path: '/dataScreen',
				name: 'home2',
				meta: { title: '附页' },
				// redirect: "/dataScreen/test",
				// component: () => import('@/views/home2/index.vue'),
				children: [
					{
						path: 'test',
						name: 'test',
						meta: { title: '列表' },
						component: () => import('@/views/home2/index.vue'),
					},
					// {
					// 	path: 'details',
					// 	name: 'details',
					// 	meta: { title: '详情' },
					// 	component: () => import('@/views/home2/details.vue'),
					// }
				]
			}
		]
	}
]

export const errorRouter: RouteRecordRaw[] = [
    {
		path: '/404',
		name: '404',
		component: () => import('@/components/ErrorMessage/404.vue'),
		meta: {
			title: '404页面'
		}
	},
	// {
	// 	path: "/:pathMatch(.*)*",
	// 	component: () => import("@/components/ErrorMessage/404.vue")
	// }
]